/*
Package routers
@Time : 2022/12/20 22:06
@Author : 董胜烨
@File : routers
@Software: GoLand
@note:
*/
package routers

import (
	v1 "employee/routers/v1"
	"github.com/gin-gonic/gin"
)

func InitRouter() *gin.Engine {
	r := gin.New()
	r.Use(gin.Logger())
	r.Use(gin.Recovery())
	apiv1 := r.Group("/api/v1")
	{

		apiv1.POST("/admin", v1.AdminLogin)

		apiv1.POST("/employee", v1.InsertEmployee)
		apiv1.GET("/employee", v1.QueryEmployee)
		apiv1.PUT("/employee", v1.UpdateEmployee)
		apiv1.DELETE("/employee", v1.DeleteEmployee)

		apiv1.GET("/attendance", v1.QueryAttendance)
		apiv1.POST("/attendance", v1.InsertAttendance)
		apiv1.PUT("/attendance", v1.UpdateAttendance)
		apiv1.DELETE("/attendance", v1.DeleteAttendance)

		apiv1.PUT("/overtime", v1.UpdateOvertime)
		apiv1.POST("/overtime", v1.InsertOvertime)
		apiv1.DELETE("/overtime", v1.DeleteOvertime)
		apiv1.GET("/overtime", v1.QueryOvertime)

		apiv1.POST("/bonus", v1.InsertBonus)
		apiv1.GET("/bonus", v1.QueryBonus)
		apiv1.PUT("/bonus", v1.UpdateBonus)
		apiv1.DELETE("/bonus", v1.DeleteBonus)

		apiv1.POST("/salary", v1.InsertSalary)
		apiv1.GET("/salary", v1.QuerySalary)
		apiv1.PUT("/salary", v1.UpdateSalary)
		apiv1.DELETE("/salary", v1.DeleteSalary)
	}
	return r
}
